using System.Collections;
using System.Collections.Generic;
using UnityEngine;

public class PassiveCycle:Upgrade {
	protected override void SubscribeEvents() {
		base.SubscribeEvents();
		MobEventHelper.updateStat.SubscribeSingle(weapon.owner,MobUpdate);
	}

	const float cycleRate = 0.25f;

	void MobUpdate(object ___,object __) {
		if(weapon.isActiveAndEnabled) return;
		weaponWeapon.state.timeAfterBurst+=deltaTime*cycleRate;
		weaponWeapon.state.timeAfterShot+=deltaTime*cycleRate;
		
		for(int _=0;_<100;_++){
			if(_==99) Debug.LogError("!!");
			if(weaponWeapon.currentBurst.nextShot==null) break;
			weaponWeapon.currentBurst.MoveToNextShot();
		}
	}

}
